The digitalization of information has resulted in a development of ways for preparing graphical information for visualization. Generally speaking the visualization of graphical information i.e. images in a two dimensional space is based on two main types of graphical information, the first of which is called vector graphics and the second of which is called raster graphics (also known as bitmap). Images based on the vector graphics are well-suited for showing ordered, exact and constructed items like text in vector graphics, lineart and diagrams. Images based on the raster graphics, in turn, are well-suited for showing disordered, approximate and natural items, like landscapes and physical objects. An additional type of content to be visualized is text wherein predetermined font libraries are used in order to visualize the textual content.
The information to be visualized as a whole, e.g. in a document page, may typically be built up from several content objects. Often the content objects represent several different content types. For example, there can be content objects of text type and content objects of bitmap type to be visualized in the final graphical presentation. The content objects are rendered to an image i.e. raster canvas, which is an uncompressed form of the graphical image comprising the content object data. In order to store and/or deliver the graphical image in a computer memory and/or to a recipient it is advantageous to compress the raster image in the raster canvas to a raster file in a bitmap format.
Prior compressing the raster image in the raster canvas, it is often practical to first optimize the raster image data to be compressed. At least some traditional solutions which seek to optimize the storage size (file size) of the data in a raster canvas are based on an idea that the optimization operations are performed to final pixel data of the raster image, representing all the content belonging to the raster image. Such operations may relate to optimizing the quality of the raster image by e.g. reducing number of colors used or reducing resolution of the raster image. The problem with especially the color reduction is that as the image content data in the raster file may comprise multiple types of content objects, these kinds of optimization operations do not take the characteristics of the different content object types anyhow into an account during the optimization phase. As a result, the content in the page as regards to at least some content objects may get inaccurate as critical details of the content visual representation may get lost, which can negatively impact the viewing experience when the content is visualized. This applies especially to textual content, which needs to be maintained sharp, while color shading based anti-alias effect is often applied around the smoothly curving details. Also, there may be other fine details to be preserved throughout the image processing in order to deliver a desired effect in the final content visualization. In addition to textual content the vector graphics are often vulnerable to optimization based on such color reduction.